.modal {
  $medium-screen: 40em !default;
  $large-screen: 53.75em !default;

  label {
    cursor: pointer;
    font-weight: normal;
    margin-bottom: 0;
  }

  .modal-state {
    display: none;
  }

  .modal-fade-screen { // overlay
    @include position(fixed, 0);
    background-color: rgba(#000, 0.85);
    opacity: 0;
    transition: opacity 0.25s ease;
    visibility: hidden;
    z-index: 99999;

    @include media($large-screen) {
      padding-top: 10em;
    }
  }

  .modal-bg {
    @include position(absolute, 0);
    cursor: pointer;
  }

  .modal-close {
    cursor: pointer;
  }

  .modal-inner {
    background-color: #fff;
    margin: auto;
    max-height: 95%;
    overflow: auto;
    position: relative;
    top: 0.5em;
    transition: opacity 0.25s ease;
    width: 95%;

    @include media($medium-screen) {
      max-height: 70%;
      width: 60%;
    }

    @include media($large-screen) {
      width: 50%;
    }
  }

  .modal-state:checked + .modal-fade-screen {
    opacity: 1;
    visibility: visible;
  }
}

.modal-open {
  overflow: hidden;
}

.modal-closed {
  overflow: auto;
}

// Based on code by Kasper Mikiewicz
